package xin.nick.demo.controller;

import xin.nick.demo.service.IDemoService;
import xin.nick.summer.annotation.Autowired;
import xin.nick.summer.annotation.Controller;
import xin.nick.summer.annotation.RequestMapping;
import xin.nick.summer.annotation.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Nick
 * @date 2021/5/29
 * @description
 */
@Controller
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private IDemoService iDemoService;


    @RequestMapping("/query")
    @Security({"admin", "张三"})
    public String query(HttpServletRequest request, HttpServletResponse response, String username) {
        return iDemoService.get(username);
    }

}
